class Solution
{
public:
    vector<int> numMovesStones(int a, int b, int c)
    {
        vector<int> pos{a, b, c};
        sort(pos.begin(), pos.end());
        int minMove = 0;
        int maxMove = 0;
        if (pos[0] + 1 != pos[1])
        {
            maxMove += pos[1] - pos[0] - 1;
        }
        if (pos[1] + 1 != pos[2])
        {
            maxMove += pos[2] - pos[1] - 1;
        }
        if (pos[0] + 2 == pos[2])
        {
            minMove = 0;
        }
        else if (pos[0] + 2 == pos[1] || pos[1] + 2 == pos[2] || pos[0] + 1 == pos[1] || pos[1] + 1 == pos[2])
        {
            minMove = 1;
        }
        else
        {
            minMove = 2;
        }
        return {minMove, maxMove};
    }
};